package service.lqx.com.servicetest;

import android.app.IntentService;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.util.Log;

public class TheIntentService extends IntentService {

    public TheIntentService() {
        super("TheIntentService");
    }

    //执行完耗时操作自动停止
    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        Log.e("IntentService", "耗时前");
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        Log.e("IntentService", "耗时后");
    }
}
